package com.sdk.springbootjwt;

import com.auth0.jwt.exceptions.JWTVerificationException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(JWTVerificationException.class)
    public ResponseEntity<String> handleJWTException(JWTVerificationException e) {
        return ResponseEntity.status(401).body("Token验证失败");
    }
}

